﻿@using System.Threading
@model EveKillboard.Core.Killmail
           
<div class="killmailHeaderContainer">
    @if (ViewBag.IsInGame){ <div style="display: inline-block"><a class="killmaildetails" href="@string.Format("killmail/details/{0}", Model.Id)"><img src="@string.Format("http://image.eveonline.com/InventoryType/{0}_32.png", Model.Destroyed.Id)" style="width: 32px; height: 32px"/></a></div>}else{@Html.Raw(string.Format("<a class=\"killmaildetails\" href=\"killmail/details/{0}\">", Model.Id))<img src="@string.Format("http://image.eveonline.com/InventoryType/{0}_32.png", Model.Destroyed.Id)" style="width: 32px; height: 32px"/>}
    <div class="killmailHeaderDestroyedBlock">
        <div class="killmailHeaderDestroyedItem">@if (ViewBag.IsInGame){ <a class="evelink" href="@string.Format("javascript:CCPEVE.showInfo({0})", Model.Destroyed.Id)">@Model.Destroyed</a>}else{ @Model.Destroyed }</div>
        <div class="killmailHeaderDestroyedGroup">@Model.Destroyed.Group</div>
    </div>
    @if (Model.AllianceId.HasValue){ <img title="@Model.Alliance.Name" src="@string.Format("http://image.eveonline.com/alliance/{0}_32.png", Model.Alliance.EveId)" width="32px" height="32px" style="border:0px"/>}else{ <img title="@Model.Corporation.Name" src="@string.Format("http://image.eveonline.com/corporation/{0}_32.png", Model.Corporation.EveId)"  width="32px" height="32px" style="border:0px"/>}
    <div class="killmailHeaderVictimBlock">
        <div class="killmailHeaderVictim">@if (ViewBag.IsInGame){ <a class="evelink" href="@string.Format("javascript:CCPEVE.showInfo(1377,{0})", Model.Entity.EveId.GetValueOrDefault(0))">@Model.Entity.Name</a> } else { @Model.Entity.Name }</div>
        <div class="killmailHeaderCorp">@if (ViewBag.IsInGame) { <a class="evelink" href="@string.Format("javascript:CCPEVE.showInfo(2,{0})", Model.Corporation.EveId)">@Model.Corporation</a> }else { @Model.Corporation }</div>    
    </div>
    <img src="../../Content/themes/base/images/location_32.png" width="32px" height="32px" style="border: 0px transparent solid;"/>
    <div class="killmailHeaderLocationBlock">
        <div class="killmailHeaderLocationSystem">@if (ViewBag.IsInGame){<a class="evelink" href="@string.Format("javascript:CCPEVE.showInfo(5,{0})", Model.Location.Id)">@Model.Location</a>}else{@string.Format(Thread.CurrentThread.CurrentUICulture, "{0} ({1})", Model.Location, Model.Location.Security)}</div>
        <div class="killmailHeaderLocationRegion">@if (ViewBag.IsInGame){<a class="evelink" href="@string.Format("javascript:CCPEVE.showInfo(5,{0})", Model.Location.RegionId)">@Model.Location.Region</a>}else{@Model.Location.Region}</div>
    </div>
    <img src="../../Content/themes/base/images/time.png" width="16px" height="16px" style="border: 0px;"/>
    <div class="killmailHeaderInvolvedCount">@Model.Date.ToShortTimeString()</div>
    <img src="../../Content/themes/base/images/involved.png" width="16px" height="16px" style="border: 0px;" />
    <div class="killmailHeaderInvolvedCount">@Model.Involved.Count()</div>
    <img src="../../Content/themes/base/images/isk_16.png" width="16px" height="16px" style="border: 0px;"  />
    <div class="killmailHeaderTotalValue">@string.Format(EveKillboard.Core.EveCustomFormatProvider.Instance, "{0:N2}", Model.GetTotalValue())</div>
   @if(!ViewBag.IsInGame){ @Html.Raw("</a>"); }
</div>
